using System;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;
using MvcMall.Core.Domains;
using MvcMall.Core.Enums;

namespace MvcMall.Data.NHibernateMaps
{
    public class StoreApplyMap : IAutoMappingOverride<StoreApply>
    {
        public void Override(AutoMapping<StoreApply> mapping)
        {
            mapping.References(c => c.User).Column("UserId");
            mapping.References(c => c.PromoteUser).Column("PromoteUser");
            mapping.References(c => c.StoreGrade).Column("StoreGradeId");
            mapping.References(c => c.StoreCat).Column("CatId");
            mapping.References(c => c.PromoteUser).Column("PromoteUser");
            mapping.Map(c => c.StoreType).CustomType(typeof (StoreType));
        }
    }
}